package ch3;

import java.util.Arrays;
import java.util.Scanner;

public class GameTest {//5：回顾：
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        float[] a = new floatsum[10];
        float sum=0;
        for (int i = 0; i < a.length; ) {
            System.out.println("请输入第" + (i + 1) + "个成绩：");
            float b = input.nextFloat();
            if (b >= 0 && b <= 10) {
                a[i] = b;
                i++;
            }else{
                System.out.println("成绩输入错误，请重新输入！");
            }
        }
        Arrays.sort(a);
        for(int i=1;i<a.length-1;i++){
            sum+=a[i];
        }
        float avg=sum/(a.length-2);
        System.out.print("该选手最终成就是："+avg);
    }
}